<script setup lang="ts">
import { ref } from 'vue'
import DynamicForm from './dynamic-form/index.vue'

defineProps<{ msg: string }>()

const formData = ref({
  name: ''
})
const formModel = {
  fields: [{
    type: 'string',
    name: 'test',
    code: 'name'
  }]
}

</script>

<template>
  <h1>{{ msg }}</h1>
  <dynamic-form ref="form" v-model="formData" :model="formModel" />
</template>

<style scoped>
a {
  color: #42b983;
}

label {
  margin: 0 0.5em;
  font-weight: bold;
}

code {
  background-color: #eee;
  padding: 2px 4px;
  border-radius: 4px;
  color: #304455;
}
</style>
